object MainData: TMainData
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Height = 329
  Width = 565
  object IBDatabase: TIBDatabase
    DatabaseName = 'D:\home\iv\real\Buro\'#1040#1056#1052' '#1058#1072#1088#1080#1092#1099'\ticketuzdiit\BD\DATA.FDB'
    Params.Strings = (
      'user_name=sysdba'
      'password=masterkey')
    LoginPrompt = False
    DefaultTransaction = IBTransaction
    AllowStreamedConnected = False
    Left = 24
    Top = 8
  end
  object IBTransaction: TIBTransaction
    DefaultDatabase = IBDatabase
    Params.Strings = (
      'read_committed'
      'rec_version'
      'nowait')
    Left = 112
    Top = 8
  end
  object TableImportGroups: TIBTable
    Database = IBDatabase
    Transaction = IBTransaction
    IndexName = 'ORD'
    TableName = 'ImportGroups'
    Left = 48
    Top = 84
    object TableImportGroupsid_Group: TIntegerField
      DisplayLabel = #1050#1086#1076' '#1075#1088#1091#1087#1080
      FieldName = 'id_Group'
      Required = True
    end
    object TableImportGroupsGroupName: TIBStringField
      DisplayLabel = #1045#1090#1072#1087' '
      DisplayWidth = 20
      FieldName = 'GroupName'
      Size = 200
    end
    object TableImportGroupsStepOrder: TIntegerField
      DisplayLabel = #1053#1086#1084#1077#1088
      FieldName = 'StepOrder'
    end
    object TableImportGroupsFORMFILE: TBlobField
      DisplayLabel = #1060#1086#1088#1084#1072
      FieldName = 'FORMFILE'
    end
  end
  object QueryViewFileData: TIBQuery
    Database = IBDatabase
    Transaction = IBTransaction
    ObjectView = True
    SQL.Strings = (
      
        'select a."Name" as AttrName , a."Code", a.parent_code, c."Name" ' +
        'as ColName, v.* from'
      '    "AttrValues" v'
      '    join "Attributs" a on a."id_attr"=v."id_attr"'
      '    join "Columns" c on c."id_col"=v."id_col"'
      'where v."id_file"=:fileid'
      'order by "Code"+parent_code, parent_code, c."id_col"')
    Left = 256
    Top = 268
    ParamData = <
      item
        DataType = ftInteger
        Name = 'fileid'
        ParamType = ptInput
      end>
    object QueryViewFileDataATTRNAME: TIBStringField
      DisplayWidth = 15
      FieldName = 'ATTRNAME'
      Origin = '"Attributs"."Name"'
      Size = 500
    end
    object QueryViewFileDataCode: TIntegerField
      FieldName = 'Code'
      Origin = '"Attributs"."Code"'
    end
    object QueryViewFileDataPARENT_CODE: TIntegerField
      FieldName = 'PARENT_CODE'
      Origin = '"Attributs"."PARENT_CODE"'
    end
    object QueryViewFileDataCOLNAME: TIBStringField
      DisplayWidth = 10
      FieldName = 'COLNAME'
      Origin = '"Columns"."Name"'
      Size = 100
    end
    object QueryViewFileDataValue: TIBStringField
      FieldName = 'Value'
      Origin = '"AttrValues"."Value"'
    end
    object QueryViewFileDataid_attr: TIntegerField
      FieldName = 'id_attr'
      Origin = '"AttrValues"."id_attr"'
      Required = True
    end
    object QueryViewFileDataid_col: TIntegerField
      FieldName = 'id_col'
      Origin = '"AttrValues"."id_col"'
      Required = True
    end
    object QueryViewFileDataid_file: TIntegerField
      FieldName = 'id_file'
      Origin = '"AttrValues"."id_file"'
      Required = True
    end
  end
  object ProcPutVal: TIBStoredProc
    Database = IBDatabase
    Transaction = IBTransaction
    StoredProcName = 'PUT_VALUE'
    Left = 272
    Top = 16
    ParamData = <
      item
        DataType = ftString
        Name = 'ATTRVAL'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'ATTRNAME'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = 'ATTRCODE'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = 'ATTRPARCODE'
        ParamType = ptInput
      end
      item
        DataType = ftString
        Name = 'COLNAME'
        ParamType = ptInput
      end
      item
        DataType = ftInteger
        Name = 'IDFILE'
        ParamType = ptInput
      end>
  end
  object GetIDSQL: TIBSQL
    Database = IBDatabase
    ParamCheck = False
    SQL.Strings = (
      'select * from get_next_id')
    Transaction = IBTransaction
    Left = 212
    Top = 16
  end
  object TableImportedFiles: TIBTable
    Database = IBDatabase
    Transaction = IBTransaction
    IndexFieldNames = 'id_calc'
    MasterFields = 'id_calc'
    MasterSource = DSTableCalcs
    TableName = 'ImportedFiles'
    Left = 48
    Top = 172
    object TableImportedFilesid_file: TIntegerField
      DisplayLabel = #1050#1086#1076' '#1092#1072#1081#1083#1091
      FieldName = 'id_file'
      Required = True
    end
    object TableImportedFilesPath: TIBStringField
      DisplayLabel = #1064#1083#1103#1093' '#1076#1086' '#1092#1072#1081#1083#1091
      DisplayWidth = 20
      FieldName = 'Path'
      Size = 200
    end
    object TableImportedFilesgroup: TStringField
      DisplayLabel = #1042#1080#1076' '#1076#1072#1085#1080#1093
      DisplayWidth = 30
      FieldKind = fkLookup
      FieldName = 'group'
      LookupDataSet = TableImportGroups
      LookupKeyFields = 'id_Group'
      LookupResultField = 'GroupName'
      KeyFields = 'id_Group'
      Size = 100
      Lookup = True
    end
    object TableImportedFilesid_Group: TIntegerField
      DisplayLabel = #1050#1086#1076' '#1075#1088#1091#1087#1080
      FieldName = 'id_Group'
      Required = True
    end
    object TableImportedFilesid_calc: TIntegerField
      DisplayLabel = #1050#1086#1076' '#1088#1086#1079#1088'.'
      FieldName = 'id_calc'
      Required = True
    end
    object TableImportedFilesInFile: TBlobField
      DisplayLabel = #1060#1072#1081#1083
      FieldName = 'InFile'
      Visible = False
    end
    object TableImportedFilesARC_ID_FILE: TIntegerField
      FieldName = 'ARC_ID_FILE'
    end
  end
  object DSTableImportGroups: TDataSource
    DataSet = TableImportGroups
    Left = 48
    Top = 128
  end
  object TableCalcs: TIBTable
    Database = IBDatabase
    Transaction = IBTransaction
    IndexName = 'DATESORT'
    TableName = 'Calcs'
    Left = 48
    Top = 268
    object TableCalcsid_calc: TIntegerField
      FieldName = 'id_calc'
      Required = True
    end
    object TableCalcsDescr: TIBStringField
      DisplayLabel = #1054#1087#1080#1089
      DisplayWidth = 20
      FieldName = 'Descr'
      Size = 200
    end
    object TableCalcsPeriod: TIBStringField
      DisplayLabel = #1047#1072' '#1087#1077#1088#1110#1086#1076
      DisplayWidth = 10
      FieldName = 'Period'
      Size = 100
    end
    object TableCalcsCreated: TDateTimeField
      DisplayLabel = #1044#1072#1090#1072' '#1089#1090#1074#1086#1088#1077#1085#1085#1103
      FieldName = 'Created'
    end
    object TableCalcsResFile: TBlobField
      DisplayLabel = #1060#1072#1081#1083
      FieldName = 'ResFile'
      Visible = False
    end
    object TableCalcsAutor: TIBStringField
      DisplayLabel = #1040#1074#1090#1086#1088
      FieldName = 'Autor'
      Size = 50
    end
    object TableCalcsCalcTmpl: TStringField
      DisplayLabel = #1047#1072' '#1089#1093#1077#1084#1086#1102
      FieldKind = fkLookup
      FieldName = 'CalcTmpl'
      LookupDataSet = TableCalcTempls
      LookupKeyFields = 'id_tmpl'
      LookupResultField = 'Descr'
      KeyFields = 'id_tmpl'
      Lookup = True
    end
    object TableCalcsid_tmpl: TIntegerField
      FieldName = 'id_tmpl'
      Visible = False
    end
  end
  object DSTableCalcs: TDataSource
    DataSet = TableCalcs
    Left = 112
    Top = 268
  end
  object TableCalcTempls: TIBTable
    Database = IBDatabase
    Transaction = IBTransaction
    TableName = 'CalcTempls'
    Left = 212
    Top = 84
    object TableCalcTemplsDescr: TIBStringField
      DisplayLabel = #1054#1087#1080#1089
      DisplayWidth = 50
      FieldName = 'Descr'
      Size = 100
    end
    object TableCalcTemplsFile: TBlobField
      FieldName = 'File'
      Visible = False
    end
    object TableCalcTemplsid_tmpl: TIntegerField
      DisplayLabel = #1050#1086#1076
      FieldName = 'id_tmpl'
      Required = True
    end
    object TableCalcTemplsMIDDLRESOPT: TIBStringField
      DisplayLabel = #1054#1087#1094#1110#1111' '#1087#1088#1086#1084#1110#1078#1085#1080#1093' '#1088#1077#1079#1091#1083#1100#1090#1072#1090#1110#1074
      DisplayWidth = 50
      FieldName = 'MIDDLRESOPT'
      Visible = False
      Size = 2000
    end
    object TableCalcTemplsRESOPT: TIBStringField
      DisplayLabel = #1054#1087#1094#1110#1111'  '#1088#1077#1079#1091#1083#1100#1090
      DisplayWidth = 50
      FieldName = 'RESOPT'
      Visible = False
      Size = 2000
    end
  end
  object TableTemplSteps: TIBTable
    Database = IBDatabase
    Transaction = IBTransaction
    IndexFieldNames = 'id_tmpl'
    MasterFields = 'id_tmpl'
    MasterSource = DSTableCalcTempls
    TableName = 'TemplSteps'
    Left = 212
    Top = 172
    object TableTemplStepsid_step: TIntegerField
      FieldName = 'id_step'
      Visible = False
    end
    object TableTemplStepsid_Group: TIntegerField
      FieldName = 'id_Group'
      Required = True
      Visible = False
    end
    object TableTemplStepsid_tmpl: TIntegerField
      FieldName = 'id_tmpl'
      Required = True
      Visible = False
    end
    object TableTemplStepsGroup: TStringField
      DisplayLabel = #1043#1088#1091#1087#1072' '#1110#1084#1087#1086#1088#1090#1091
      DisplayWidth = 40
      FieldKind = fkLookup
      FieldName = 'Group'
      LookupDataSet = TableImportGroups
      LookupKeyFields = 'id_Group'
      LookupResultField = 'GroupName'
      KeyFields = 'id_Group'
      Size = 100
      Lookup = True
    end
    object TableTemplStepsDestSheet: TIBStringField
      DisplayLabel = #1051#1080#1089#1090
      DisplayWidth = 20
      FieldName = 'DestSheet'
      Size = 50
    end
    object TableTemplStepsDestRange: TIBStringField
      DisplayLabel = #1054#1073#1083#1072#1089#1090#1100
      DisplayWidth = 20
      FieldName = 'DestRange'
      Size = 100
    end
  end
  object DSTableCalcTempls: TDataSource
    DataSet = TableCalcTempls
    Left = 212
    Top = 128
  end
  object QueryArcSelect: TIBQuery
    Database = IBDatabase
    Transaction = IBTransaction2
    ObjectView = True
    SQL.Strings = (
      'select i."id_Group", i."Path", i."id_file",c.*'
      
        'from "Calcs" c join  "ImportedFiles" i on c."id_calc"=i."id_calc' +
        '"'
      'where arc_id_file is null'
      'order by c."Created" desc')
    OnFilterRecord = QueryArcSelectFilterRecord
    Left = 348
    Top = 264
    object QueryArcSelectid_Group: TIntegerField
      FieldName = 'id_Group'
      Origin = '"ImportedFiles"."id_Group"'
      Required = True
    end
    object QueryArcSelectPath: TIBStringField
      FieldName = 'Path'
      Origin = '"ImportedFiles"."Path"'
      Size = 200
    end
    object QueryArcSelectid_file: TIntegerField
      FieldName = 'id_file'
      Origin = '"ImportedFiles"."id_file"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object QueryArcSelectid_calc: TIntegerField
      FieldName = 'id_calc'
      Origin = '"Calcs"."id_calc"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object QueryArcSelectDescr: TIBStringField
      FieldName = 'Descr'
      Origin = '"Calcs"."Descr"'
      Size = 200
    end
    object QueryArcSelectPeriod: TIBStringField
      FieldName = 'Period'
      Origin = '"Calcs"."Period"'
      Size = 100
    end
    object QueryArcSelectCreated: TDateTimeField
      FieldName = 'Created'
      Origin = '"Calcs"."Created"'
    end
    object QueryArcSelectResFile: TBlobField
      FieldName = 'ResFile'
      Origin = '"Calcs"."ResFile"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object QueryArcSelectAutor: TIBStringField
      FieldName = 'Autor'
      Origin = '"Calcs"."Autor"'
      Size = 50
    end
    object QueryArcSelectid_tmpl: TIntegerField
      FieldName = 'id_tmpl'
      Origin = '"Calcs"."id_tmpl"'
    end
  end
  object QueryAutors: TIBQuery
    Database = IBDatabase
    Transaction = IBTransaction2
    ObjectView = True
    SQL.Strings = (
      'select distinct c."Autor"'
      'from "Calcs" c ')
    OnFilterRecord = QueryArcSelectFilterRecord
    Left = 428
    Top = 260
    object QueryAutorsAutor: TIBStringField
      FieldName = 'Autor'
      Origin = '"Calcs"."Autor"'
      Size = 50
    end
  end
  object TableImportedFilesTmp: TIBTable
    Database = IBDatabase
    Transaction = IBTransaction
    ReadOnly = True
    TableName = 'ImportedFiles'
    Left = 48
    Top = 216
    object IntegerField1: TIntegerField
      FieldName = 'id_file'
      Required = True
    end
    object IBStringField1: TIBStringField
      DisplayLabel = #1064#1083#1103#1093' '#1076#1086' '#1092#1072#1081#1083#1091
      DisplayWidth = 20
      FieldName = 'Path'
      Size = 200
    end
    object StringField1: TStringField
      DisplayLabel = #1042#1080#1076' '#1076#1072#1085#1080#1093
      DisplayWidth = 30
      FieldKind = fkLookup
      FieldName = 'group'
      LookupDataSet = TableImportGroups
      LookupKeyFields = 'id_Group'
      LookupResultField = 'GroupName'
      KeyFields = 'id_Group'
      Size = 100
      Lookup = True
    end
    object IntegerField2: TIntegerField
      FieldName = 'id_Group'
      Required = True
    end
    object IntegerField3: TIntegerField
      FieldName = 'id_calc'
      Required = True
    end
    object BlobField1: TBlobField
      DisplayLabel = #1060#1072#1081#1083
      FieldName = 'InFile'
      Visible = False
    end
    object IntegerField4: TIntegerField
      FieldName = 'ARC_ID_FILE'
    end
  end
  object IBTransaction2: TIBTransaction
    DefaultDatabase = IBDatabase
    Params.Strings = (
      'read_committed'
      'rec_version'
      'nowait')
    Left = 112
    Top = 56
  end
end
